package com.mezz.bones.im.logic.repository;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mezz.bones.im.common.message.body.in.ConversationRecordReq;
import com.mezz.bones.im.common.message.body.in.ConversationRemoveReq;
import com.mezz.bones.im.common.message.body.in.ConversationTopReq;
import com.mezz.bones.im.logic.domain.bo.ChatConversationInitBo;
import com.mezz.bones.im.logic.domain.bo.ChatConversationLatestDataBo;
import com.mezz.bones.im.logic.domain.entity.ChatConversation;
import com.mezz.bones.im.logic.domain.response.ApiMessageUnReadCountResponse;

import java.util.List;

/**
 * <p>
 * IM会话列表 服务类
 * </p>
 *
 * @author mezz
 * @since 2024-12-20
 */
public interface IChatConversationRepository extends IService<ChatConversation> {

    ChatConversation getByUserIdAndPeerId(String userId, String peerId);
    ChatConversation initPrivateConversation(ChatConversationInitBo chatConversationInitBo);

    void updateChatConversation(ChatConversationLatestDataBo bo);

    void updateConversationUnreadNum(String conversationId, Integer changeNum);

    void clearConversationUnreadNum(String conversationId);

    List<ChatConversation> findUserConversationPage(ConversationRecordReq req);

    void removeConversation(ConversationRemoveReq req);

    void topConversation(ConversationTopReq req);

    void updateLastPeerReadSeq(String id, String hasReadMsgSeq);

    void updateLastUserReadSeq(String id, String hasReadMsgSeq);

    ApiMessageUnReadCountResponse countUnreadMessage(String userId);
}
